Skip to content

[6.x] Fix incorrect update badges in the Control Panel updater#14890

Merged
jasonvarga merged 2 commits into
statamic:6.xfrom
aaronbushnell:version-compare-bug-fix
Jul 7, 2026
Merged

[6.x] Fix incorrect update badges in the Control Panel updater#14890
jasonvarga merged 2 commits into
statamic:6.xfrom
aaronbushnell:version-compare-bug-fix

Conversation

@aaronbushnell

@aaronbushnell aaronbushnell commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Fixes two cases where the updater showed the wrong badge:

  1. Installed version newer than the marketplace (e.g. installed 7.12.1, marketplace still indexes 7.12.0) showed a false "Update available". Addon::isLatestVersion() now treats equal-or-newer as up to date.

  2. Paginating the changelog flipped the header badge ("Update available" → "Up to date", or "Security update available" → "Update available"), because it was derived from the current page. The badges are now computed server-side across all releases and returned from the changelog endpoint.

Related:

…ketplace latest

The update check treated "not exactly equal to the marketplace's latest"
as "an update is available", rather than "the installed version is older
than the latest". This surfaced an "Update available" badge whenever a
local install was ahead of the marketplace's indexed version (e.g. in the
window between a release landing on Packagist and the marketplace indexing
it).

- Addon::isLatestVersion() now uses `>=` instead of strict equality, so an
  install equal to or newer than the marketplace latest is up to date.
- The per-product updater badge derives "up to date" from the changelog's
  release types (no `upgrade` releases) instead of a string comparison,
  matching the server's classification and the count badge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@aaronbushnell aaronbushnell marked this pull request as ready for review June 27, 2026 01:47
@craigcastledine

Copy link
Copy Markdown

Experiencing this also on 6.24.1. Same story on my end with three Alt Design addons that are each one release ahead of the marketplace's latest_version (alt-inbound 2.0.1 vs 2.0.0, alt-redirect 1.8.0 vs 1.7.0, alt-seo 1.4.2 vs 1.4.1). Result: a stuck "3" on the Updates badge while the Updates page happily says everything's up to date. Your fix sorts it.

@duncanmcclean

Copy link
Copy Markdown
Member

Thanks for the PR!

The underlying issue should now be fixed on the Marketplace side — see my comment here: #10277 (comment). I've leave it to @jasonvarga to decide whether it's still worth merging this as an extra safeguard.

@aaronbushnell

Copy link
Copy Markdown
Contributor Author

Thanks, @duncanmcclean! This might also be useful if and when future beta versions of Statamic (or addons) are installed, but the CMS shows there are "updates". Since you're not on the same version as what's in the Marketplace you might still see those badges notifying you to make an update.

The "Up to date" and "Security update available" header badges were derived
from the current changelog page. Paginating past page 1 (which holds the
newest, upgrade-typed releases) left only older releases, so both badges
dropped incorrectly. Return onLatestVersion and securityUpdateAvailable from
the changelog endpoint, computed across the full release set, and bind them
directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jasonvarga jasonvarga changed the title [6.x] Fix false "Update available" when installed version is newer than marketplace version [6.x] Fix incorrect update badges in the Control Panel updater Jul 7, 2026
@jasonvarga

Copy link
Copy Markdown
Member

Thanks for this! I pushed a couple of changes on top:

  • While testing, I noticed the same class of bug on the updater's changelog page: the "Up to date" / "Security update available" badges are derived from the current page of releases, so paginating past page 1 flipped them incorrectly. I moved that logic server-side — the changelog endpoint now returns onLatestVersion and securityUpdateAvailable computed across all releases, and Updater.vue just binds them. That also let the latestRelease/latestVersion bits go away.
  • Your Updater.vue change was the same idea, just page-scoped, so this supersedes it.

I updated the PR title and description to reflect it.

By the way, Duncan's .com changes have hopefully addressed your initial problem, but if not, this PR is a nice defense in depth anyway.

@jasonvarga jasonvarga merged commit cd4ad2f into statamic:6.x Jul 7, 2026
21 checks passed
@aaronbushnell aaronbushnell deleted the version-compare-bug-fix branch July 7, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants